/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.taobao.ibatiside.model.mapperv3.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.taobao.ibatiside.model.mapperv3.Mapperv3Package;
import org.taobao.ibatiside.model.mapperv3.Trim;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Trim</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.taobao.ibatiside.model.mapperv3.impl.TrimImpl#getPrefix <em>Prefix</em>}</li>
 *   <li>{@link org.taobao.ibatiside.model.mapperv3.impl.TrimImpl#getPrefixOverrides <em>Prefix Overrides</em>}</li>
 *   <li>{@link org.taobao.ibatiside.model.mapperv3.impl.TrimImpl#getSuffix <em>Suffix</em>}</li>
 *   <li>{@link org.taobao.ibatiside.model.mapperv3.impl.TrimImpl#getSuffixOverrides <em>Suffix Overrides</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TrimImpl extends CommonNestedStatementImpl implements Trim {
	/**
	 * The default value of the '{@link #getPrefix() <em>Prefix</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrefix()
	 * @generated
	 * @ordered
	 */
	protected static final String PREFIX_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPrefix() <em>Prefix</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrefix()
	 * @generated
	 * @ordered
	 */
	protected String prefix = PREFIX_EDEFAULT;

	/**
	 * The default value of the '{@link #getPrefixOverrides() <em>Prefix Overrides</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrefixOverrides()
	 * @generated
	 * @ordered
	 */
	protected static final String PREFIX_OVERRIDES_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getPrefixOverrides() <em>Prefix Overrides</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrefixOverrides()
	 * @generated
	 * @ordered
	 */
	protected String prefixOverrides = PREFIX_OVERRIDES_EDEFAULT;

	/**
	 * The default value of the '{@link #getSuffix() <em>Suffix</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSuffix()
	 * @generated
	 * @ordered
	 */
	protected static final String SUFFIX_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSuffix() <em>Suffix</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSuffix()
	 * @generated
	 * @ordered
	 */
	protected String suffix = SUFFIX_EDEFAULT;

	/**
	 * The default value of the '{@link #getSuffixOverrides() <em>Suffix Overrides</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSuffixOverrides()
	 * @generated
	 * @ordered
	 */
	protected static final String SUFFIX_OVERRIDES_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSuffixOverrides() <em>Suffix Overrides</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSuffixOverrides()
	 * @generated
	 * @ordered
	 */
	protected String suffixOverrides = SUFFIX_OVERRIDES_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TrimImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return Mapperv3Package.Literals.TRIM;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPrefix() {
		return prefix;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPrefix(String newPrefix) {
		String oldPrefix = prefix;
		prefix = newPrefix;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Mapperv3Package.TRIM__PREFIX, oldPrefix, prefix));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getPrefixOverrides() {
		return prefixOverrides;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPrefixOverrides(String newPrefixOverrides) {
		String oldPrefixOverrides = prefixOverrides;
		prefixOverrides = newPrefixOverrides;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Mapperv3Package.TRIM__PREFIX_OVERRIDES, oldPrefixOverrides, prefixOverrides));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getSuffix() {
		return suffix;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSuffix(String newSuffix) {
		String oldSuffix = suffix;
		suffix = newSuffix;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Mapperv3Package.TRIM__SUFFIX, oldSuffix, suffix));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getSuffixOverrides() {
		return suffixOverrides;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSuffixOverrides(String newSuffixOverrides) {
		String oldSuffixOverrides = suffixOverrides;
		suffixOverrides = newSuffixOverrides;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Mapperv3Package.TRIM__SUFFIX_OVERRIDES, oldSuffixOverrides, suffixOverrides));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case Mapperv3Package.TRIM__PREFIX:
				return getPrefix();
			case Mapperv3Package.TRIM__PREFIX_OVERRIDES:
				return getPrefixOverrides();
			case Mapperv3Package.TRIM__SUFFIX:
				return getSuffix();
			case Mapperv3Package.TRIM__SUFFIX_OVERRIDES:
				return getSuffixOverrides();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case Mapperv3Package.TRIM__PREFIX:
				setPrefix((String)newValue);
				return;
			case Mapperv3Package.TRIM__PREFIX_OVERRIDES:
				setPrefixOverrides((String)newValue);
				return;
			case Mapperv3Package.TRIM__SUFFIX:
				setSuffix((String)newValue);
				return;
			case Mapperv3Package.TRIM__SUFFIX_OVERRIDES:
				setSuffixOverrides((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case Mapperv3Package.TRIM__PREFIX:
				setPrefix(PREFIX_EDEFAULT);
				return;
			case Mapperv3Package.TRIM__PREFIX_OVERRIDES:
				setPrefixOverrides(PREFIX_OVERRIDES_EDEFAULT);
				return;
			case Mapperv3Package.TRIM__SUFFIX:
				setSuffix(SUFFIX_EDEFAULT);
				return;
			case Mapperv3Package.TRIM__SUFFIX_OVERRIDES:
				setSuffixOverrides(SUFFIX_OVERRIDES_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case Mapperv3Package.TRIM__PREFIX:
				return PREFIX_EDEFAULT == null ? prefix != null : !PREFIX_EDEFAULT.equals(prefix);
			case Mapperv3Package.TRIM__PREFIX_OVERRIDES:
				return PREFIX_OVERRIDES_EDEFAULT == null ? prefixOverrides != null : !PREFIX_OVERRIDES_EDEFAULT.equals(prefixOverrides);
			case Mapperv3Package.TRIM__SUFFIX:
				return SUFFIX_EDEFAULT == null ? suffix != null : !SUFFIX_EDEFAULT.equals(suffix);
			case Mapperv3Package.TRIM__SUFFIX_OVERRIDES:
				return SUFFIX_OVERRIDES_EDEFAULT == null ? suffixOverrides != null : !SUFFIX_OVERRIDES_EDEFAULT.equals(suffixOverrides);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (prefix: ");
		result.append(prefix);
		result.append(", prefixOverrides: ");
		result.append(prefixOverrides);
		result.append(", suffix: ");
		result.append(suffix);
		result.append(", suffixOverrides: ");
		result.append(suffixOverrides);
		result.append(')');
		return result.toString();
	}

} //TrimImpl
